<template>
  <uni-list>
    <uni-list-item
      v-for="(item,index) in options"
      :key="index"
      :title="item.label"
      :note="detailData[item.prop]"
    >
    </uni-list-item>
  </uni-list>
</template>

<script>
import { apis as APIS } from "@/api/zxjc/zxjcrw.js";
import Card from "./components/Card";

export default {
  data() {
    return {
      id: null,
      detailData: {},
      options: [
        {
          label: "任务名称",
          prop: "governCheckTaskName",
        },
        {
          label: "任务类型",
          prop: "governTaskTypeName",
        },
        {
          label: "检查类型",
          prop: "governCheckTaskTypeName",
        },
        {
          label: "任务描述",
          prop: "governTaskContent",
        },
        {
          label: "任务开始时间",
          prop: "governTaskStartTime",
        },
        {
          label: "任务结束时间",
          prop: "governTaskEndTime",
        },
        {
          label: "检查单位",
          prop: "governCheckCompany",
        },
        {
          label: "检查来源",
          prop: "governCheckSource",
        },
        {
          label: "危险源",
          prop: "governInvolveDanger",
        },
        {
          label: "检查项",
          prop: "governCheckContent",
        },
        {
          label: "检查依据",
          prop: "governCheckBasis",
        },
        {
          label: "检查方式",
          prop: "governCheckWay",
        },
        {
          label: "使用场合",
          prop: "governApplicablePlace",
        },
        {
          label: "检查结果",
          prop: "governCheckResult",
        }
      ]
    }
  },
  components: {
    Card
  },
  onLoad(option) {
    this.id = option.id
  },
  onShow() {
    this.fGetTaskItemDetail()
  },
  methods: {
    fGetTaskItemDetail(){
      APIS.getTaskItemDetail( this.id ).then(res => {
        this.detailData = res.data
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>